﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>

<h1 id="dateTimeConverter">DateTimeConverter</h1>
<p>DateTimeConverter converts a DateTime value during data binding using specified format string.</p>
<p><strong>Namespace </strong></p>
<p><code>StoreAppLib.Converters</code></p>
<p><strong>Using DateTimeConverter</strong></p>
<p>To use DateTimeConverter in your project, add the reference to StoreAppLib project or install StoreAppLib from Visual Studio &quot;Manage NuGet Packages&quot; tool.</p>
<p>To use the converter while binding first declare the converter in the App.xaml file.</p>
<p><code><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">Application<br /></span><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp; </span><span style="color: red; font-size: 9.5pt;" lang="EN"><strong>xmlns</strong></span><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">:</span></strong><strong><span style="color: red; font-size: 9.5pt;" lang="EN">storeApp</span></strong><strong><span style="color: red; font-size: 9.5pt;">Converter</span></strong><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">="using:StoreAppLib.Converters"</span></strong><span style="color: blue; font-size: 9.5pt;" lang="EN"><br /></span><span style="color: blue; font-size: 9.5pt;">&nbsp;&nbsp; ...</span><span style="color: black; font-size: 9.5pt;"> </span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;<br /></span><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp; </span><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">Application.Resources</span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;<br /></span><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">ResourceDictionary</span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;</span></code></p>
<p><code><strong><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;</span></strong><strong><span style="color: red; font-size: 9.5pt;" lang="EN">storeApp</span></strong><strong><span style="color: red; font-size: 9.5pt;">Converter</span></strong><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">:</span></strong><strong><span style="color: #a31515; font-size: 9.5pt;" lang="EN">DateTimeConverter</span></strong><strong><span style="color: red; font-size: 9.5pt;" lang="EN"> x</span></strong><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">:</span></strong><strong><span style="color: red; font-size: 9.5pt;" lang="EN">Key</span></strong><strong><span style="color: blue; font-size: 9.5pt;" lang="EN">="DateTimeConverter" /&gt;</span></strong><strong><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp;&nbsp;</span></strong></code></p>
<p><code><strong><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;</span></strong><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;/</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">ResourceDictionary</span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;<br /></span><span style="color: black; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp; </span><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;/</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">Application.Resources</span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;<br />&lt;/</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">Application</span><span style="color: blue; font-size: 9.5pt;" lang="EN">&gt;</span></code></p>
<p>Following code shows the usage of the converter while binding.</p>
<p><code><span style="color: blue; font-size: 9.5pt;" lang="EN">&lt;</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">TextBlock</span><span style="color: red; font-size: 9.5pt;" lang="EN"> Width</span><span style="color: blue; font-size: 9.5pt;" lang="EN">="150"</span><span style="color: red; font-size: 9.5pt;" lang="EN"> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Height</span><span style="color: blue; font-size: 9.5pt;" lang="EN">="30"<br /></span><span style="color: red; font-size: 9.5pt;" lang="EN">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text</span><span style="color: blue; font-size: 9.5pt;" lang="EN">="{</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">Binding</span><span style="color: red; font-size: 9.5pt;" lang="EN"> CurrentDate</span><span style="color: blue; font-size: 9.5pt;" lang="EN">,</span><span style="color: red; font-size: 9.5pt;" lang="EN"> Converter</span><span style="color: blue; font-size: 9.5pt;" lang="EN">={</span><span style="color: #a31515; font-size: 9.5pt;" lang="EN">StaticResource</span><span style="color: red; font-size: 9.5pt;" lang="EN"> DateTimeConverter</span><span style="color: blue; font-size: 9.5pt;" lang="EN">},</span><span style="color: red; font-size: 9.5pt;" lang="EN"> ConverterParameter</span><span style="color: blue; font-size: 9.5pt;" lang="EN">='dd-MMM-yyyy'}" /&gt;</span></code></p>

</body>
</html>
